<%@ page import="union.Competencia" %>

<h3>Dados de competencia</h3>

<div class="fieldcontain ${hasErrors(bean: competenciaInstance, field: 'nome', 'error')} required">
	<label for="nome">
		<g:message code="competencia.nome.label" default="Nome" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="nome" required="" value="${competenciaInstance?.nome}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: competenciaInstance, field: 'descricao', 'error')} ">
	<label for="descricao">
		<g:message code="competencia.descricao.label" default="Descricao" />
		
	</label>
	<g:textField name="descricao" value="${competenciaInstance?.descricao}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: competenciaInstance, field: 'competenciasContrato', 'error')} ">
	<label for="competenciasContrato">
		<g:message code="competencia.competenciasContrato.label" default="Competencias Contrato" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${competenciaInstance?.competenciasContrato?}" var="c">
    <li><g:link controller="competenciasContrato" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="competenciasContrato" action="create" params="['competencia.id': competenciaInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'competenciasContrato.label', default: 'CompetenciasContrato')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: competenciaInstance, field: 'indicador', 'error')} required">
	<label for="indicador">
		<g:message code="competencia.indicador.label" default="Indicador" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="indicador" name="indicador.id" from="${union.Indicador.list()}" optionKey="id" required="" value="${competenciaInstance?.indicador?.id}" class="many-to-one"/>
</div>

